﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Stp.Core;
using Stp.Core.Services;
using Stp.Test.Fakes;

namespace Stp.Test
{
    [TestClass]
    public class LogoutServiceTest
    {
        [TestMethod]
        public void LogoutService_ExceptionTest()
        {
            FakeAccount fAccount = new FakeAccount();
            fAccount.SetException = true;

            LogoutService lService = new LogoutService(fAccount);
            ActionResult aResult = lService.Execute();

            Assert.IsFalse(aResult.IsSuccessful);
            Assert.AreEqual("Test Exception.", aResult.Messages);
        }

        [TestMethod]
        public void LogoutSerivce_AllGoodConditionTest()
        {
            FakeAccount fAccount = new FakeAccount();
            fAccount.SetException = false;

            LogoutService lService = new LogoutService(fAccount);
            ActionResult aResult = lService.Execute();

            Assert.IsTrue(aResult.IsSuccessful);
            Assert.AreEqual(string.Empty, aResult.Messages);
        }
    }
}
